1. Field of the Invention
The present invention relates to a network formation method used for direct communication between communication apparatuses and a communication apparatus.
2. Description of the Related Art
Wireless LANs defined in IEEE802.11 (hereafter referred to as 802.11 wireless LANs) use the “infrastructure mode”, in which communication is effected via access points between communication devices (communication terminals), and the “ad-hoc mode”, in which communication is effected directly between communication devices. In the ad-hoc mode of an 802.11 wireless LAN, a communication device attempting to construct a network builds the network by transmitting a pilot signal called a beacon. Communication devices participating in the network join the network and effect communication based on information contained in such a beacon (beacon period, transmission rate, etc.).
Moreover, wireless communication parameters, such as communication channels, network identifiers, encryption methods, and cryptographic keys, have to be set to values common to all the communication devices that constitute the network. In an 802.11 wireless LAN, there are two network identifiers called “SSID” (Service Set Identification) and “BSSID” (Basic Service Set Identification) (see Japanese Patent Laid-Open No. 2006-74450 or Japanese Patent Laid-Open No. 2006-54707).
An SSID is an identifier that can be set to any arbitrary value by a user and can be pre-configured in a communication device. On the other hand, a BSSID is an identifier that is arbitrarily generated by the communication device constructing an ad-hoc network, that is, the communication device initially transmitting a beacon, based on its own MAC (Media Access Control) address, etc. When communication is effected on the same network, these two network identifiers have to be set to common values shared by the communication devices.
For instance, it is assumed that a common SSID is set in advance between two communication devices in order to effect communication therebetween in an ad-hoc mode. In such a case, an ad-hoc network is constructed when one of the communication devices generates a BSSID and initiates transmission of a beacon comprising the BSSID and the common SSID. The other communication device can join the constructed ad-hoc network by searching for a beacon and setting the BSSID for itself.
However, when two communication devices with the same SSID nearly simultaneously try to construct an ad-hoc network, two networks having different BSSIDs may be constructed as a result of generation of respective BSSIDs by each one of the communication devices. In such a case, communication between the two communication devices is rendered impossible despite the fact that a common SSID has been set.
As disclosed in Japanese Patent Laid-Open No. 10-145276, network construction is carried out by the device having more remaining battery capacity. However, it is not disclosed how the above-described duplicate network construction problem can be resolved.
Moreover, even if it turns out to be possible to avoid such a duplicate network construction problem and a network having a unique SSID and BSSID is constructed, the following problems may still arise.
When a communication device joins a network in the infrastructure mode, it carries out the process of association (logical connection) with an access point. The communication device determines the BSSID of the network by passive scanning or active scanning, configures the BSSID, and associates with the access point, thereby enabling communication in the infrastructure mode. Put otherwise, the communication device that joins the network in the infrastructure mode provides notification of joining the network in the communication layer (primarily the physical layer, MAC layer) of the 802.11 wireless LAN.
On the other hand, association processing is not performed between communicating communication devices in the ad-hoc mode. Namely, in the ad-hoc mode, even when another communication device joins a network, communication devices that already participate in the network are not notified of the fact that another communication device has joined the network in the communication layer of the 802.11 wireless LAN. For this reason, network-joining notification information is exchanged using an application (hereafter referred to as “upper-layer application”) in a communication layer higher than the communication layer of the 802.11 wireless LAN. As a result, the communication device that constructed the network can recognize a communication device joining the network.
As an example, let us consider a case, in which a captured image is transmitted and received via an ad-hoc network between two digital cameras equipped with 802.11 wireless LAN features. It is assumed that the process of construction of an ad-hoc network is started when an instruction to commence connection is carried out in the two digital cameras.
In such a case, when an instruction to commence connection is issued from the sender digital camera, a network is constructed (transmission of a beacon is initiated) and the recipient digital camera joins the constructed network. When the process of joining is complete, the recipient digital camera notifies the upper-layer application of joining the network.
Upon construction of the network, the sender digital camera periodically searches for communication devices participating in the network using the upper-layer application (for instance, UPnP: Universal Plug & Play). When the results of the search indicate that a recipient digital camera has joined the network, a message prompting for image transfer instructions is displayed on the display of the sender digital camera. Subsequently, user instructions from an operator input unit are received and image transmission/reception is carried out via the ad-hoc network.
Here, if some time is required for the recipient digital camera to join the network, a certain time will pass between the moment when the instruction to commence connection is issued by the sender digital camera and the moment when the message prompting for image transfer instructions is displayed. In other words, user operability will suffer. Furthermore, similar problems arise with other methods of use (for instance, when a digital camera is remotely operated by another digital camera).